{% extends "base_blank.volt" %}

{% block pageHeader %}
{{ stylesheet_link('/assets/manage/css/editor_pt.css', false) }}
{% endblock %}

{% block pageFooter %}
<script type="text/javascript">
    var contentType = '{{ type }}';
    var domainPic = '{{ this.di.get('appConfig').application.domainPic }}';
</script>
{{ javascript_include("/libs/jquery-libs/jquery-drag.js", false) }}
{{ javascript_include("/libs/jquery-libs/jquery-drop.js", false) }}
{{ javascript_include("/assets/manage/js/editor_pt.js", false) }}
{% endblock %}

{% block content %}
<div class="panel panel-default">
    <div class="panel-body">
        <div id="main_box"></div>
        <div id="but_box">
            <button id="but_add_img" type="button" class="btn btn-info btn-sm"><i class="fa fa-picture-o"></i> 添加图片</button>
            <button id="but_add_text" type="button" class="btn btn-info btn-sm"><i class="fa fa-text-height"></i> 添加文本</button>
            <button id="but_add_title" type="button" class="btn btn-info btn-sm"><i class="fa fa-list-ul"></i> 添加标题</button>
            <p class="help-block">每个模块项目可以拖动排序</p>
        </div>
    </div>
    <div class="panel-footer text-center">
        <button id="but-save" type="button" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
    </div>
</div>
<div id="box_editor" class="hide">
    <i class="arrow arrow_out"></i>
    <i class="arrow arrow_in"></i>
    <div class="editor">
        <div class="inner">
            <form id="form_img" class="hide" role="form" method="post" action="{{ url.get('tools/editorPTUploadImg') }}" target="ifr_send_file" enctype="multipart/form-data">
                <div class="form-group">
                    <label for="file_img">图片文件</label>
                    <input type="hidden" name="content_type" value="{{ type }}">
                    <input type="hidden" name="callback" value="parent.setFormResultImg">
                    <input class="form-control" type="file" id="file_img" name="file">
                    <p class="help-block">支持jpg、png图片格式，宽必须是750px，大小不得超过1M。</p>
                </div>
                <div class="form-group text-right">
                    <button type="submit" class="btn btn-primary"><i class="fa fa-file-image-o"></i> 上 传</button>
                </div>
            </form>
            <div id="form_text" class="hide">
                <div class="form-group">
                    <label for="text_content">文本内容</label>
                    <textarea class="form-control" name="content" id="text_content" rows="8"></textarea>
                    <p class="help-block">可以使用加粗标签“b”，<br />例如：&lt;b&gt;需要加粗的文字&lt;/b&gt;</p>
                </div>
                <div class="form-group text-right">
                    <button id="editor_save_text" type="button" class="btn btn-primary"><i class="fa fa-floppy-o"></i> 确 定</button>
                </div>
            </div>
            <div id="form_title" class="hide">
                <div class="form-group">
                    <label for="text_content">标题内容</label>
                    <input class="form-control" name="content" id="title_content" />
                </div>
                <div class="form-group text-right">
                    <button id="editor_save_title" type="button" class="btn btn-primary"><i class="fa fa-floppy-o"></i> 确 定</button>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}